﻿#region Copyright (c) 2012-10, Olaf Kober <amarok.projects@gmail.com>
//================================================================================
//	Permission is hereby granted, free of charge, to any person obtaining a copy
//	of this software and associated documentation files (the "Software"), to deal
//	in the Software without restriction, including without limitation the rights
//	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//	copies of the Software, and to permit persons to whom the Software is
//	furnished to do so, subject to the following conditions:
//
//	The above copyright notice and this permission notice shall be included in
//	all copies or substantial portions of the Software.
//
//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//	THE SOFTWARE.
//================================================================================
#endregion

#if TESTS

using System;
using Amarok.Resources;
using NUnit.Framework;


namespace Amarok
{
	[TestFixture]
	public class Test_Verify
	{
		private interface InterfaceA
		{
		}

		private class ClassA : InterfaceA
		{
		}

		private class ClassB : ClassA
		{
		}

		private class ClassC
		{
		}


		// --- TESTS ---



		#region NotNull

		[Test]
		public void Test_NotNull_NullArgument()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.NotNull(null, "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotNull_NullArgument_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.NotNull(null, "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotNull_ValidArguments()
		{
			Verify.NotNull(this, "PARAM");
			Verify.NotNull(this, "PARAM", () => "MESSAGE");
		}

		#endregion

		#region NotEmpty

		[Test]
		public void Test_NotEmpty_NullArgument()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.NotEmpty(null, "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotEmpty_NullArgument_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.NotEmpty(null, "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotEmpty_EmptyStringArgument()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.NotEmpty("", "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.EmptyStringArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotEmpty_EmptyStringArgument_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.NotEmpty("", "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_NotEmpty_ValidArgument()
		{
			Verify.NotEmpty("A", "PARAM");
			Verify.NotEmpty("A", "PARAM", () => "MESSAGE");
			Verify.NotEmpty(" ", "PARAM");
			Verify.NotEmpty(" ", "PARAM", () => "MESSAGE");
		}

		#endregion

		#region NotNegative

		[Test]
		public void Test_NotNegative_Int32()
		{
			Verify.NotNegative((Int32)0, "PARAM");
			Verify.NotNegative((Int32)1, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Int32)(-1), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_NotNegative_Int32_MessageFunc()
		{
			Verify.NotNegative((Int32)0, "PARAM", () => "MESSAGE");
			Verify.NotNegative((Int32)1, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Int32)(-1), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_NotNegative_Int64()
		{
			Verify.NotNegative((Int64)0, "PARAM");
			Verify.NotNegative((Int64)1, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Int64)(-1), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_NotNegative_Int64_MessageFunc()
		{
			Verify.NotNegative((Int64)0, "PARAM", () => "MESSAGE");
			Verify.NotNegative((Int64)1, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Int64)(-1), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_NotNegative_Double()
		{
			Verify.NotNegative((Double)0, "PARAM");
			Verify.NotNegative((Double)1, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Double)(-1), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_NotNegative_Double_MessageFunc()
		{
			Verify.NotNegative((Double)0, "PARAM", () => "MESSAGE");
			Verify.NotNegative((Double)1, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Double)(-1), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_NotNegative_Decimal()
		{
			Verify.NotNegative((Decimal)0, "PARAM");
			Verify.NotNegative((Decimal)1, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Decimal)(-1), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_NotNegative_Decimal_MessageFunc()
		{
			Verify.NotNegative((Decimal)0, "PARAM", () => "MESSAGE");
			Verify.NotNegative((Decimal)1, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative((Decimal)(-1), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_NotNegative_TimeSpan()
		{
			Verify.NotNegative(TimeSpan.FromSeconds(0), "PARAM");
			Verify.NotNegative(TimeSpan.FromSeconds(1), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative(TimeSpan.FromSeconds((-1)), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(-1)));
		}

		[Test]
		public void Test_NotNegative_TimeSpan_MessageFunc()
		{
			Verify.NotNegative(TimeSpan.FromSeconds(0), "PARAM", () => "MESSAGE");
			Verify.NotNegative(TimeSpan.FromSeconds(1), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.NotNegative(TimeSpan.FromSeconds((-1)), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(-1)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region AtLeast

		[Test]
		public void Test_AtLeast_Byte()
		{
			Verify.AtLeast((Byte)10, (Byte)10, "PARAM");
			Verify.AtLeast((Byte)11, (Byte)10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Byte)9, (Byte)10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
		}

		[Test]
		public void Test_AtLeast_Byte_MessageFunc()
		{
			Verify.AtLeast((Byte)10, (Byte)10, "PARAM", () => "MESSAGE");
			Verify.AtLeast((Byte)11, (Byte)10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Byte)9, (Byte)10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_Int32()
		{
			Verify.AtLeast((Int32)10, 10, "PARAM");
			Verify.AtLeast((Int32)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Int32)9, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
		}

		[Test]
		public void Test_AtLeast_Int32_MessageFunc()
		{
			Verify.AtLeast((Int32)10, 10, "PARAM", () => "MESSAGE");
			Verify.AtLeast((Int32)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Int32)9, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_Int64()
		{
			Verify.AtLeast((Int64)10, 10, "PARAM");
			Verify.AtLeast((Int64)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Int64)9, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
		}

		[Test]
		public void Test_AtLeast_Int64_MessageFunc()
		{
			Verify.AtLeast((Int64)10, 10, "PARAM", () => "MESSAGE");
			Verify.AtLeast((Int64)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Int64)9, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_Double()
		{
			Verify.AtLeast((Double)10, 10, "PARAM");
			Verify.AtLeast((Double)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Double)9, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
		}

		[Test]
		public void Test_AtLeast_Double_MessageFunc()
		{
			Verify.AtLeast((Double)10, 10, "PARAM", () => "MESSAGE");
			Verify.AtLeast((Double)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Double)9, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_Decimal()
		{
			Verify.AtLeast((Decimal)10, 10, "PARAM");
			Verify.AtLeast((Decimal)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Decimal)9, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
		}

		[Test]
		public void Test_AtLeast_Decimal_MessageFunc()
		{
			Verify.AtLeast((Decimal)10, 10, "PARAM", () => "MESSAGE");
			Verify.AtLeast((Decimal)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast((Decimal)9, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(9));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_TimeSpan()
		{
			Verify.AtLeast(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM");
			Verify.AtLeast(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(9)));
		}

		[Test]
		public void Test_AtLeast_TimeSpan_MessageFunc()
		{
			Verify.AtLeast(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");
			Verify.AtLeast(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(9)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtLeast_DateTime()
		{
			var now = DateTime.Now;

			Verify.AtLeast(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM");
			Verify.AtLeast(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(9)));
		}

		[Test]
		public void Test_AtLeast_DateTime_MessageFunc()
		{
			var now = DateTime.Now;

			Verify.AtLeast(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");
			Verify.AtLeast(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtLeast(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(9)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region AtMost

		[Test]
		public void Test_AtMost_Byte()
		{
			Verify.AtMost((Byte)9, (Byte)10, "PARAM");
			Verify.AtMost((Byte)10, (Byte)10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Byte)11, (Byte)10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
		}

		[Test]
		public void Test_AtMost_Byte_MessageFunc()
		{
			Verify.AtMost((Byte)9, (Byte)10, "PARAM", () => "MESSAGE");
			Verify.AtMost((Byte)10, (Byte)10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Byte)11, (Byte)10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_Int32()
		{
			Verify.AtMost((Int32)9, 10, "PARAM");
			Verify.AtMost((Int32)10, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Int32)11, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
		}

		[Test]
		public void Test_AtMost_Int32_MessageFunc()
		{
			Verify.AtMost((Int32)9, 10, "PARAM", () => "MESSAGE");
			Verify.AtMost((Int32)10, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Int32)11, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_Int64()
		{
			Verify.AtMost((Int64)9, 10, "PARAM");
			Verify.AtMost((Int64)10, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Int64)11, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
		}

		[Test]
		public void Test_AtMost_Int64_MessageFunc()
		{
			Verify.AtMost((Int64)9, 10, "PARAM", () => "MESSAGE");
			Verify.AtMost((Int64)10, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Int64)11, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_Double()
		{
			Verify.AtMost((Double)9, 10, "PARAM");
			Verify.AtMost((Double)10, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Double)11, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
		}

		[Test]
		public void Test_AtMost_Double_MessageFunc()
		{
			Verify.AtMost((Double)9, 10, "PARAM", () => "MESSAGE");
			Verify.AtMost((Double)10, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Double)11, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_Decimal()
		{
			Verify.AtMost((Decimal)9, 10, "PARAM");
			Verify.AtMost((Decimal)10, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Decimal)11, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
		}

		[Test]
		public void Test_AtMost_Decimal_MessageFunc()
		{
			Verify.AtMost((Decimal)9, 10, "PARAM", () => "MESSAGE");
			Verify.AtMost((Decimal)10, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost((Decimal)11, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(11));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_TimeSpan()
		{
			Verify.AtMost(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM");
			Verify.AtMost(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(11)));
		}

		[Test]
		public void Test_AtMost_TimeSpan_MessageFunc()
		{
			Verify.AtMost(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");
			Verify.AtMost(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(11)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_AtMost_DateTime()
		{
			var now = DateTime.Now;

			Verify.AtMost(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM");
			Verify.AtMost(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(11)));
		}

		[Test]
		public void Test_AtMost_DateTime_MessageFunc()
		{
			var now = DateTime.Now;

			Verify.AtMost(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");
			Verify.AtMost(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.AtMost(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(11)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region IsGreater

		[Test]
		public void Test_IsGreater_Byte()
		{
			Verify.IsGreater((Byte)11, (Byte)10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Byte)10, (Byte)10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsGreater_Byte_MessageFunc()
		{
			Verify.IsGreater((Byte)11, (Byte)10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Byte)10, (Byte)10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_Int32()
		{
			Verify.IsGreater((Int32)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Int32)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsGreater_Int32_MessageFunc()
		{
			Verify.IsGreater((Int32)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Int32)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_Int64()
		{
			Verify.IsGreater((Int64)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Int64)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsGreater_Int64_MessageFunc()
		{
			Verify.IsGreater((Int64)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Int64)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_Double()
		{
			Verify.IsGreater((Double)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Double)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsGreater_Double_MessageFunc()
		{
			Verify.IsGreater((Double)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Double)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_Decimal()
		{
			Verify.IsGreater((Decimal)11, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Decimal)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsGreater_Decimal_MessageFunc()
		{
			Verify.IsGreater((Decimal)11, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater((Decimal)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_TimeSpan()
		{
			Verify.IsGreater(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(10)));
		}

		[Test]
		public void Test_IsGreater_TimeSpan_MessageFunc()
		{
			Verify.IsGreater(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(10)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsGreater_DateTime()
		{
			var now = DateTime.Now;

			Verify.IsGreater(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(10)));
		}

		[Test]
		public void Test_IsGreater_DateTime_MessageFunc()
		{
			var now = DateTime.Now;

			Verify.IsGreater(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsGreater(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(10)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region IsLess

		[Test]
		public void Test_IsLess_Byte()
		{
			Verify.IsLess((Byte)9, (Byte)10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Byte)10, (Byte)10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsLess_Byte_MessageFunc()
		{
			Verify.IsLess((Byte)9, (Byte)10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Byte)10, (Byte)10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_Int32()
		{
			Verify.IsLess((Int32)9, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Int32)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsLess_Int32_MessageFunc()
		{
			Verify.IsLess((Int32)9, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Int32)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_Int64()
		{
			Verify.IsLess((Int64)9, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Int64)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsLess_Int64_MessageFunc()
		{
			Verify.IsLess((Int64)9, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Int64)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_Double()
		{
			Verify.IsLess((Double)9, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Double)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsLess_Double_MessageFunc()
		{
			Verify.IsLess((Double)9, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Double)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_Decimal()
		{
			Verify.IsLess((Decimal)9, 10, "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Decimal)10, 10, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
		}

		[Test]
		public void Test_IsLess_Decimal_MessageFunc()
		{
			Verify.IsLess((Decimal)9, 10, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess((Decimal)10, 10, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(10));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_TimeSpan()
		{
			Verify.IsLess(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(10)));
		}

		[Test]
		public void Test_IsLess_TimeSpan_MessageFunc()
		{
			Verify.IsLess(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(10)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_IsLess_DateTime()
		{
			var now = DateTime.Now;

			Verify.IsLess(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(10)));
		}

		[Test]
		public void Test_IsLess_DateTime_MessageFunc()
		{
			var now = DateTime.Now;

			Verify.IsLess(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.IsLess(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10), "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(10)));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region InRange

		[Test]
		public void Test_InRange_Byte()
		{
			Verify.InRange((Byte)10, (Byte)10, (Byte)20, "PARAM");
			Verify.InRange((Byte)11, (Byte)10, (Byte)20, "PARAM");
			Verify.InRange((Byte)19, (Byte)10, (Byte)20, "PARAM");
			Verify.InRange((Byte)20, (Byte)10, (Byte)20, "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Byte)9, (Byte)10, (Byte)20, "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Byte)21, (Byte)10, (Byte)20, "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
		}

		[Test]
		public void Test_InRange_Byte_MessageFunc()
		{
			Verify.InRange((Byte)10, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE");
			Verify.InRange((Byte)11, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE");
			Verify.InRange((Byte)19, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE");
			Verify.InRange((Byte)20, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Byte)9, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Byte)21, (Byte)10, (Byte)20, "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_Int32()
		{
			Verify.InRange((Int32)10, 10, 20, "PARAM");
			Verify.InRange((Int32)11, 10, 20, "PARAM");
			Verify.InRange((Int32)19, 10, 20, "PARAM");
			Verify.InRange((Int32)20, 10, 20, "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int32)9, 10, 20, "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int32)21, 10, 20, "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
		}

		[Test]
		public void Test_InRange_Int32_MessageFunc()
		{
			Verify.InRange((Int32)10, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int32)11, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int32)19, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int32)20, 10, 20, "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int32)9, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int32)21, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_Int64()
		{
			Verify.InRange((Int64)10, 10, 20, "PARAM");
			Verify.InRange((Int64)11, 10, 20, "PARAM");
			Verify.InRange((Int64)19, 10, 20, "PARAM");
			Verify.InRange((Int64)20, 10, 20, "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int64)9, 10, 20, "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int64)21, 10, 20, "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
		}

		[Test]
		public void Test_InRange_Int64_MessageFunc()
		{
			Verify.InRange((Int64)10, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int64)11, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int64)19, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Int64)20, 10, 20, "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int64)9, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Int64)21, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_Double()
		{
			Verify.InRange((Double)10, 10, 20, "PARAM");
			Verify.InRange((Double)11, 10, 20, "PARAM");
			Verify.InRange((Double)19, 10, 20, "PARAM");
			Verify.InRange((Double)20, 10, 20, "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Double)9, 10, 20, "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Double)21, 10, 20, "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
		}

		[Test]
		public void Test_InRange_Double_MessageFunc()
		{
			Verify.InRange((Double)10, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Double)11, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Double)19, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Double)20, 10, 20, "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Double)9, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Double)21, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_Decimal()
		{
			Verify.InRange((Decimal)10, 10, 20, "PARAM");
			Verify.InRange((Decimal)11, 10, 20, "PARAM");
			Verify.InRange((Decimal)19, 10, 20, "PARAM");
			Verify.InRange((Decimal)20, 10, 20, "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Decimal)9, 10, 20, "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Decimal)21, 10, 20, "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
		}

		[Test]
		public void Test_InRange_Decimal_MessageFunc()
		{
			Verify.InRange((Decimal)10, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Decimal)11, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Decimal)19, 10, 20, "PARAM", () => "MESSAGE");
			Verify.InRange((Decimal)20, 10, 20, "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Decimal)9, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(9));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange((Decimal)21, 10, 20, "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(21));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_TimeSpan()
		{
			Verify.InRange(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(TimeSpan.FromSeconds(19), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(9)));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(TimeSpan.FromSeconds(21), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(21)));
		}

		[Test]
		public void Test_InRange_TimeSpan_MessageFunc()
		{
			Verify.InRange(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
				"PARAM", () => "MESSAGE");
			Verify.InRange(TimeSpan.FromSeconds(11), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
				"PARAM", () => "MESSAGE");
			Verify.InRange(TimeSpan.FromSeconds(19), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
				"PARAM", () => "MESSAGE");
			Verify.InRange(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
				"PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
					"PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(9)));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(TimeSpan.FromSeconds(21), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20),
					"PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(TimeSpan.FromSeconds(21)));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		[Test]
		public void Test_InRange_DateTime()
		{
			var now = DateTime.Now;

			Verify.InRange(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(now + TimeSpan.FromSeconds(19), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM");
			Verify.InRange(now + TimeSpan.FromSeconds(20), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10),
					now + TimeSpan.FromSeconds(20), "PARAM"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(9)));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(now + TimeSpan.FromSeconds(21), now + TimeSpan.FromSeconds(10),
					now + TimeSpan.FromSeconds(20), "PARAM"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(21)));
		}

		[Test]
		public void Test_InRange_DateTime_MessageFunc()
		{
			var now = DateTime.Now;

			Verify.InRange(now + TimeSpan.FromSeconds(10), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE");
			Verify.InRange(now + TimeSpan.FromSeconds(11), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE");
			Verify.InRange(now + TimeSpan.FromSeconds(19), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE");
			Verify.InRange(now + TimeSpan.FromSeconds(20), now + TimeSpan.FromSeconds(10),
				now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE");

			var exception1 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(now + TimeSpan.FromSeconds(9), now + TimeSpan.FromSeconds(10),
					now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE"));

			Assert.That(exception1.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception1.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(9)));
			Assert.That(exception1.Message, Is.StringContaining("MESSAGE"));

			var exception2 = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.InRange(now + TimeSpan.FromSeconds(21), now + TimeSpan.FromSeconds(10),
					now + TimeSpan.FromSeconds(20), "PARAM", () => "MESSAGE"));

			Assert.That(exception2.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception2.ActualValue, Is.EqualTo(now + TimeSpan.FromSeconds(21)));
			Assert.That(exception2.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region IsUniversalTime

		[Test]
		public void Test_IsUniversalTime()
		{
			Verify.IsUniversalTime(DateTime.Now.ToUniversalTime(), "PARAMNAME");
			Verify.IsUniversalTime(DateTime.UtcNow, "PARAMNAME");

			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsUniversalTime(DateTime.Now, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
		}

		[Test]
		public void Test_IsUniversalTime_MessageFunc()
		{
			Verify.IsUniversalTime(DateTime.Now.ToUniversalTime(), "PARAMNAME", () => "MESSAGE");
			Verify.IsUniversalTime(DateTime.UtcNow, "PARAMNAME", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsUniversalTime(DateTime.Now, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region IsLocalTime

		[Test]
		public void Test_IsLocalTime()
		{
			Verify.IsLocalTime(DateTime.UtcNow.ToLocalTime(), "PARAMNAME");
			Verify.IsLocalTime(DateTime.Now, "PARAMNAME");

			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsLocalTime(DateTime.UtcNow, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
		}

		[Test]
		public void Test_IsLocalTime_MessageFunc()
		{
			Verify.IsLocalTime(DateTime.UtcNow.ToLocalTime(), "PARAMNAME", () => "MESSAGE");
			Verify.IsLocalTime(DateTime.Now, "PARAMNAME", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsLocalTime(DateTime.UtcNow, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
		}

		#endregion

		#region BufferSegment

		[Test]
		public void Test_BufferSegment_NullBuffer()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.BufferSegment(null, 0, 0));

			Assert.That(exception.ParamName, Is.EqualTo("buffer"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_BufferSegment_NullBuffer_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.BufferSegment(null, 0, 0, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("buffer"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_BufferSegment_NegativeOffset()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], -1, 3));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.ValueMustBePositive));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_NegativeOffset_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], -1, 3, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_NegativeCount()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 3, -1));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.ValueMustBePositive));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_NegativeCount_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 3, -1, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_Offset_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 5, 0));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(5));
		}

		[Test]
		public void Test_BufferSegment_Offset_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 5, 0, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(5));
		}

		[Test]
		public void Test_BufferSegment_Offset_ExceedsBufferLength_EmptyBuffer()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[0], 1, 0));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(1));
		}

		[Test]
		public void Test_BufferSegment_Offset_ExceedsBufferLength_EmptyBuffer_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[0], 1, 0, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(1));
		}

		[Test]
		public void Test_BufferSegment_Count_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 0, 6));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.CountExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_Count_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 0, 6, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_OffsetAndCount_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 2, 4));

			Assert.That(exception.ParamName, Is.EqualTo("offset + count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetAndCountExceedBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_OffsetAndCount_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new Byte[5], 2, 4, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset + count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegments_ValidArguments()
		{
			Verify.BufferSegment(new Byte[5], 0, 5);
			Verify.BufferSegment(new Byte[5], 1, 4);
			Verify.BufferSegment(new Byte[5], 4, 1);
			Verify.BufferSegment(new Byte[5], 0, 0);
			Verify.BufferSegment(new Byte[5], 3, 0);
			Verify.BufferSegment(new Byte[0], 0, 0);
		}

		[Test]
		public void Test_BufferSegments_ValidArguments_MessageFunc()
		{
			Verify.BufferSegment(new Byte[5], 0, 5, () => "MESSAGE");
			Verify.BufferSegment(new Byte[5], 1, 4, () => "MESSAGE");
			Verify.BufferSegment(new Byte[5], 4, 1, () => "MESSAGE");
			Verify.BufferSegment(new Byte[5], 0, 0, () => "MESSAGE");
			Verify.BufferSegment(new Byte[5], 3, 0, () => "MESSAGE");
			Verify.BufferSegment(new Byte[0], 0, 0, () => "MESSAGE");
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_NegativeOffset()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), -1, 3));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.ValueMustBePositive));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_NegativeOffset_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), -1, 3, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_NegativeCount()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 3, -1));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.ValueMustBePositive));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_NegativeCount_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 3, -1, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(-1));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_Offset_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 5, 0));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(5));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_Offset_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 5, 0, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(5));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_Offset_ExceedsBufferLength_EmptyBuffer()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[3], 1, 0), 1, 0));

			Assert.That(exception.ParamName, Is.EqualTo("offset"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(1));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_Count_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 0, 6));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.CountExceedsBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_Count_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 0, 6, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_OffsetAndCount_ExceedsBufferLength()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 2, 4));

			Assert.That(exception.ParamName, Is.EqualTo("offset + count"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.OffsetAndCountExceedBufferLength));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegment_WithinBufferSegment_OffsetAndCount_ExceedsBufferLength_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentOutOfRangeException>(() =>
				Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 2, 4, () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("offset + count"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
			Assert.That(exception.ActualValue, Is.EqualTo(6));
		}

		[Test]
		public void Test_BufferSegments_WithinBufferSegment_ValidArguments()
		{
			Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 0, 5);
			Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 1, 4);
			Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 4, 1);
			Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 0, 0);
			Verify.BufferSegment(new BufferSegment(new Byte[7], 1, 5), 3, 0);
			Verify.BufferSegment(new BufferSegment(new Byte[3], 1, 0), 0, 0);
		}

		#endregion

		#region IsSubclassOf

		[Test]
		public void Test_IsSubclassOf()
		{
			Verify.IsSubclassOf(typeof(ClassB), typeof(ClassA), "PARAM");
		}

		[Test]
		public void Test_IsSubclassOf_NotASubClass()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsSubclassOf(typeof(ClassC), typeof(ClassA), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_NotASubClass_Interface()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsSubclassOf(typeof(ClassA), typeof(InterfaceA), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_SameType()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsSubclassOf(typeof(ClassA), typeof(ClassA), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_NullValue()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsSubclassOf(null, typeof(ClassA), "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_NullBaseType()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsSubclassOf(typeof(ClassA), null, "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_NullValue_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsSubclassOf(null, typeof(ClassA), "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsSubclassOf_NotASubClass_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsSubclassOf(typeof(ClassC), typeof(ClassA), "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		#endregion

		#region IsAssignableTo

		[Test]
		public void Test_IsAssignableTo()
		{
			Verify.IsAssignableTo(typeof(ClassB), typeof(ClassA), "PARAM");
		}

		[Test]
		public void Test_IsAssignableTo_NotASubClass()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsAssignableTo(typeof(ClassC), typeof(ClassA), "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsAssignableTo_RealizesInterface()
		{
			Verify.IsAssignableTo(typeof(ClassA), typeof(InterfaceA), "PARAM");
		}

		[Test]
		public void Test_IsAssignableTo_SameType()
		{
			Verify.IsAssignableTo(typeof(ClassA), typeof(ClassA), "PARAM");
		}

		[Test]
		public void Test_IsAssignableTo_NullValue()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsAssignableTo(null, typeof(ClassA), "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsAssignableTo_NullTargetType()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsAssignableTo(typeof(ClassA), null, "PARAM"));

			Assert.That(exception.Message, Is.StringContaining(VerifyResources.NullArgument));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsAssignableTo_NullValue_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentNullException>(() =>
				Verify.IsAssignableTo(null, typeof(ClassA), "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_IsAssignableTo_NotASubClass_MessageFunc()
		{
			var exception = Assert.Throws<ArgumentException>(() =>
				Verify.IsAssignableTo(typeof(ClassC), typeof(ClassA), "PARAM", () => "MESSAGE"));

			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.InnerException, Is.Null);
		}

		#endregion

		#region That

		[Test]
		public void Test_That()
		{
			Verify.That(true, "PARAM");

			var exception = Assert.Throws<ArgumentException>(() =>
					Verify.That(false, "PARAM"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.Message, Is.StringContaining(VerifyResources.InvalidArgument));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_That_MessageFunc()
		{
			Verify.That(true, "PARAM", () => "MESSAGE");

			var exception = Assert.Throws<ArgumentException>(() =>
					Verify.That(false, "PARAM", () => "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
		}

		[Test]
		public void Test_That_Message()
		{
			Verify.That(true, "PARAM", "MESSAGE");

			var exception = Assert.Throws<ArgumentException>(() =>
					Verify.That(false, "PARAM", "MESSAGE"));

			Assert.That(exception.ParamName, Is.EqualTo("PARAM"));
			Assert.That(exception.Message, Is.StringContaining("MESSAGE"));
			Assert.That(exception.InnerException, Is.Null);
		}

		#endregion

	}
}

#endif
